package com.metis.document.parse.dialog.pipeline.impl;

import com.metis.document.parse.dialog.pipeline.TextPostProcess;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;

import java.util.regex.Pattern;

/**
 * 目录下内容.识别成！
 */
@Slf4j
@Component
public class DirectoryContentProcess implements TextPostProcess {

    private static final Pattern pattern = Pattern.compile("\\!{3,}");

    @Override
    public String process(@NotNull String input) {
        if(pattern.matcher(input).find()){
            input = input.replaceAll("!","");
        }
        return input;
    }
}
